<!--  -->
<template>
  <div class="uda_inner">
    <div>  <button class="btn" @click="dialogFormVisible = true">审核</button>
    <el-dialog
      title="学年：2019-2020 学期：2"
      :visible.sync="dialogFormVisible"
      :modal="false"
      class="parent-form"
    >
      <el-form :model="form" class="form">
          <div class="form_border_top"></div>
        <el-form-item label="*姓名" :label-width="formLabelWidth">           
          <el-input v-model="ref.name" autocomplete="off" value="" class="input" ></el-input>
        </el-form-item>        
        <el-form-item label="*学年" :label-width="formLabelWidth">
          <el-input v-model="ref.week" autocomplete="off" value="" class="input" ></el-input>
        </el-form-item>
        <el-form-item label="*课程" :label-width="formLabelWidth">
          <el-input v-model="ref.course" autocomplete="off" value="" class="input" ></el-input>
        </el-form-item>
        <el-form-item label="*说明" :label-width="formLabelWidth" >
          <el-input v-model="ref.instructions" autocomplete="off" value="" class="input" ></el-input>
        </el-form-item>
        <div class="form_border-bottom"></div>
        <el-form-item label="审核结果" :label-width="formLabelWidth" >           
          <el-select v-model="form.pass" placeholder="" class="input">
            <el-option label="审核通过" value="pass"></el-option>
            <el-option label="不通过，拒绝" value="notpass"></el-option>
          </el-select>
        </el-form-item> 
        <el-form-item label="审核意见" :label-width="formLabelWidth">           
          <el-select v-model="form.tpass" class="input">
            <el-option label="情况属实" value="pass_inner"></el-option>
            <el-option label="请完善证明条件" value="pass_to"></el-option>
            <el-option label="不符合条件" value="notpass_to"></el-option>
          </el-select>
        </el-form-item>      
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible = false">取 消</el-button>
        <el-button type="primary" @click="dialogFormVisible=false"
          >确 定</el-button
        >
      </div>
    </el-dialog>
</div>
  
    <div class="uda-mid">
      <template>
        <el-table :data="tableData" tooltip-effect="dark" style="width: 100%"  @selection-change="handleSelectionChange"
        highlight-current-row="true">
          <el-table-column type="selection" width="60"> </el-table-column>
          <el-table-column prop="num" label="序号" width="100">
          </el-table-column>

          <el-table-column prop="studentId" label="学号" width="120">
          </el-table-column>
          <el-table-column prop="name" label="姓名" width="80">
          </el-table-column>
          <el-table-column prop="week" label="学年|学期" width="140">
          </el-table-column>
          <el-table-column prop="course" label="课程" width="120">
          </el-table-column>
          <el-table-column prop="instructions" label="说明" width="260">
          </el-table-column>
          <el-table-column prop="editor" label="操作" width="120">
            <template>
              <el-button type="text" >查看</el-button>
              
              <!-- <el-button type="text" size="small">状态</el-button> -->
            </template>      
          </el-table-column>
          


           <el-table-column prop="flash" label="状态" width="120">
          </el-table-column>
        </el-table>
      </template>
    </div>
  </div>
</template>

<script>
//这里可以导入其他文件（比如：组件，工具js，第三方插件js，json文件，图片文件等等）
//例如：import 《组件名称》 from '《组件路径》';

export default {
  //import引入的组件需要注入到对象中才能使用
  components: {},
  data() {
    //这里存放数据
    return {
      tableData: [
       
      ],
      ref:{},
      dialogFormVisible: false,
      form: {
        name: "1、因个人心脏原因申请免修该课程 2、证明材料详情见附件",
        pass:"--请选择--",
        tpass:"--请选择--",
        region: "--请选择--",
        date1: "",
        date2: "",
        delivery: false,
        type: [],
        resource: "",
        desc: "",
       
      },
      formLabelWidth: "120px",
      dialogFormVisibles: false,
      


    };
  },
  //监听属性 类似于data概念
  computed: {},
  //监控data中的数据变化
  watch: {},
  //方法集合
  methods: {
    handleSelectionChange:function(res){
      console.log(res)
        const sss ={}     
      for(let key in res[0]){
        sss[key]=res[0][key];
      }
      this.ref = sss
      // console.log(this.form.ref)
      // console.log(this.$attrs)
      // return this.ref
    },


  },
  //生命周期 - 创建完成（可以访问当前this实例）
  async created() {
    let res = await this.$http.get("/audit")
    this.tableData=res.tableData
    // console.log(this.tableData)
 
   
  },
  //生命周期 - 挂载完成（可以访问DOM元素）
  mounted() {},
  beforeCreate() {}, //生命周期 - 创建之前
  beforeMount() {}, //生命周期 - 挂载之前
  beforeUpdate() {}, //生命周期 - 更新之前
  updated() {}, //生命周期 - 更新之后
  beforeDestroy() {}, //生命周期 - 销毁之前
  destroyed() {}, //生命周期 - 销毁完成
  activated() {}, //如果页面有keep-alive缓存功能，这个函数会触发
};
</script>
<style scoped>
.uda_inner {
  min-height: 300px;
  overflow: hidden;
  padding: 30px;
}
.btn {
  width: 60px;
  height: 30px;
  font-size: 14px;
  background: #66b1ff;
  border-radius: 5px;
  border: none;
  color: #fff;
  outline: none;
  float: right;
}
.input{
  width: 300px;
  height: 50px;
}
.form_border_top{
  border-top: 1px solid #ccc;
  margin-bottom: 30px;
}
.form_border-bottom{
  border-top: 1px solid #ccc;
  margin-bottom: 30px;
}


</style>
